<template>
  <div>
      <div v-for="i in journalism_list" :key="i.id">
         <h4> 新闻标题:{{i.title}}</h4>
         <h4>新闻内容:{{i.content}}</h4>
         <router-link :to="{'path':'/comment','query':{'id':i.id}}">提交</router-link>
      </div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            journalism_list:[]
        }
    },created(){
        axios.get('/api/journalism').then(resp=>{
            console.log(resp.data)
            this.journalism_list=resp.data
        }).catch(error=>{
            console.log(error)
        })
    }
}
</script>

<style>

</style>